﻿using WmsService.Security;

namespace WmsService
{
    public class ServiceBase
    {
        protected string ContextUserID
        {
            get
            {
                return AuthenticationFactory.GetAuthentication().GetCurrentUserID();
            }
        }

        protected string ContextUserName
        {
            get
            {
                return AuthenticationFactory.GetAuthentication().GetCurrentUserName();
            }
        }

        private IAuthentication authen = null;
        protected void SecurityValidate()
        {
            if (authen == null)
            {
                authen = AuthenticationFactory.GetAuthentication();
            }
            authen.ValidateToken();
        }
      
    }
}